testgtk: Don't set cairo surfaces as icons
authorBenjamin Otte <otte@redhat.com>
Wed, 11 Apr 2018 23:29:15 +0000 (01:29 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 12 Apr 2018 12:03:48 +0000 (14:03 +0200)
The code expects textures these days, so use those.

tests/testgtk.c

index e9b8bcbde678ef996697e709964fe37119c134f9..626104bce3a75bf440cb57782d4d690ec15fa5b0 100644 (file)
@@ -5415,7 +5415,7 @@ create_wmhints (GtkWidget *widget)
   GtkWidget *box2;
   GdkSurface *gdk_surface;
   GdkPixbuf *pixbuf;
-  cairo_surface_t *surface;
+  GdkTexture *texture;
   GList *list;
 
   if (!window)
@@ -5436,14 +5436,14 @@ create_wmhints (GtkWidget *widget)
       gdk_surface = gtk_widget_get_surface (window);
 
       pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile);
-      surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
+      texture = gdk_texture_new_for_pixbuf (pixbuf);
 
-      list = g_list_prepend (NULL, surface);
+      list = g_list_prepend (NULL, texture);
 
       gtk_window_set_icon_list (GTK_WINDOW (window), list);
 
       g_list_free (list);
-      cairo_surface_destroy (surface);
+      g_object_unref (texture);
       g_object_unref (pixbuf);
 
       gdk_surface_set_icon_name (gdk_surface, "WMHints Test Icon");